home *** CD-ROM | disk | FTP | other *** search
- ; *******************************************************
- ; Example 1 - Open a browser with the form example, set the value of a text form element
- ; *******************************************************
- ;
- #include <IE.au3>
- $oIE = _IE_Example ("form")
- $oForm = _IEFormGetObjByName ($oIE, "ExampleForm")
- $oText = _IEFormElementGetObjByName ($oForm, "textExample")
- _IEFormElementSetValue ($oText, "Hey! This works!")
-
- ; *******************************************************
- ; Example 2 - Get a reference to a specific form element and set its value.
- ; In this case, submit a query to the Google search engine
- ; *******************************************************
- ;
- #include <IE.au3>
- $oIE = _IECreate ("http://www.google.com")
- $oForm = _IEFormGetObjByName ($oIE, "f")
- $oQuery = _IEFormElementGetObjByName ($oForm, "q")
- _IEFormElementSetValue ($oQuery, "AutoIt IE.au3")
- _IEFormSubmit ($oForm)
-
- ; *******************************************************
- ; Example 3 - Login to Hotmail
- ; *******************************************************
- ;
- #include <IE.au3>
- ; Create a browser window and navigate to hotmail
- $oIE = _IECreate ("http://www.hotmail.com")
-
- ; get pointers to the login form and username, password and signin fields
- $o_form = _IEFormGetObjByName ($oIE, "f1")
- $o_login = _IEFormElementGetObjByName ($o_form, "login")
- $o_password = _IEFormElementGetObjByName ($o_form, "passwd")
- $o_signin = _IEFormElementGetObjByName ($o_form, "SI")
-
- $username = "your username here"
- $password = "your password here"
-
- ; Set field values and submit the form
- _IEFormElementSetValue ($o_login, $username)
- _IEFormElementSetValue ($o_password, $password)
- _IEAction ($o_signin, "click")